<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:p="http://primefaces.org/ui"
	template="/templates/mainTemplate.xhtml">
	
	<f:metadata>
		<f:event type="preRenderView"
			listener="#{autorBean.initConversation}" />
	</f:metadata>
	
	<ui:define name="content">
		
		<h1>#{msg['autor.titulo.cadastro']}</h1>
		
		<h:form id="autorForm">
			
			<p:messages />
			
			<p:panelGrid columns="3">
				#{msg['autor.nome']}
				<p:inputText value="#{autorBean.entidade.nome}" id="nome" label="#{msg['autor.nome']}" />
				<p:message for="nome" />
				
				#{msg['autor.cpf']}
				<p:inputText value="#{autorBean.entidade.cpf}" id="cpf" label="#{msg['autor.cpf']}" />
				<p:message for="cpf" />	
			</p:panelGrid>
			
			<p:commandButton value="#{msg['botao.salvar']}" action="#{autorBean.salvar}" update="autorForm" />
			<p:commandButton value="#{msg['botao.cancelar']}" action="#{autorBean.cancelar}" immediate="true" />
			
		</h:form>

	</ui:define>
</ui:composition>
